<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="java.util.List"%>
<%@ page import="org.dualr.litelog.entity.Comment"%>
<%@ page import="org.dualr.litelog.entity.Page"%>
<%@ page import="org.dualr.litelog.utils.LiteLogUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Comment - LiteLog Administration</title>
<link href="../admin/common.css" rel="stylesheet" type="text/css" media="screen"/>
</head>
<body>
<h1>评论管理</h1>
<div>
<table class="data-list" width="100%" cellspacing="0" cellpadding="0">
	<tr class="caption">
		<td width="28">序号</td>
		<td >留言内容</td>
		<td width="80">IP</td>
		<td width="50">Author</td>
		<td width="100">Mail</td>
		<td width="50">回复</td>
		<td width="60">查看文章</td>
		<td width="30">删除</td>
	</tr>
	<%
		List<Comment> commentList = (List<Comment>)request.getAttribute("commentList");
		if (commentList.size() != 0 ){
			int i = 1;
			for(Comment comment : commentList){
	%>
	<tr>
		<td ><%=i++%></td>
		<td ><%=comment.getContent().getValue()%></td>
		<td width="80"><%=comment.getIp()%></td>
		<td width="50"><%=comment.getAuthor()%></td>
		<td width="100"><%=comment.getMail()%></td>
		<td width="50"><%=comment.getReplyMailMark()%></td>
		<td width="50"><a href="post?method=view&id=<%=comment.getPostId()%>" target="_blank">查看文章</a></td>
		<td width="30"><a href="admin?entity=comment&option=delete&id=<%=comment.getId()%>&postId=<%=comment.getPostId()%>">删除</a></td>
	</tr>
		<%
			}
			Page pages = (Page)request.getAttribute("Page");
			%>
			<tr>
				<td colspan="8" id="page">
				记录数:<%=pages.getHits()%> [<a href="admin?entity=comment&option=list&page=<%=pages.getPrevPage()%>">上一页</a>]<%=pages.getCurPage()%>/<%=pages.getPageNum()%>[<a href="admin?entity=comment&option=list&page=<%=pages.getNextPage()%>">下一页</a>]
				</td>
			</tr>
			<%
		}else{
			%>
			<tr>
				<td colspan="8">列表为空</td>
			</tr>
			<%
		}
	%>
</table>
</div>
</body>
</html>